Skip to content

Conversation

L-Applin
Copy link
Contributor

@L-Applin L-Applin commented Sep 22, 2025

Adding new CRT bindings to s3 crt async client.

Motivation and Context

New bindings were added in version 0.39.0 for file operations.

Modifications

  • bump crt to version 0.39.0
  • new public (@SdkPublicApi) config class: S3CrtFileIoConfiguration
  • new methods for config in S3CrtAsyncClientBuilder
  • new advancedOptions method in crt builder for the new SdkAdvancedAsyncClientOption.CRT_UPLOAD_FILE_DIRECT_IO
  • S3NativeClientConfiguration modified to include the new FileIoOptionfrom CRT

@L-Applin L-Applin marked this pull request as ready for review September 26, 2025 16:44
@L-Applin L-Applin requested a review from a team as a code owner September 26, 2025 16:44
@L-Applin L-Applin requested a review from joviegas September 26, 2025 16:49
@L-Applin L-Applin added the api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team label Sep 26, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
35.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud


/**
* The estimated disk throughput in gigabits per second (Gbps).
* Only applied when {@code shouldStream} is true.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like typo and should be {@code uploadBufferDisabled}

* @param shouldStream whether to stream the file
* @return The builder for method chaining.
*/
Builder uploadBufferDisabled(Boolean shouldStream);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Builder uploadBufferDisabled(Boolean shouldStream);
Builder uploadBufferDisabled(Boolean uploadBufferDisabled);


/**
* The estimated disk throughput in gigabits per second (Gbps).
* Only applied when {@code shouldStream} is true.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also mention in Java doc why shouldStream is referenced as uploadBufferDisabled in Java client?

}

private static FileIoOptions resolveFileIoOptions(Builder builder) {
S3CrtFileIoConfiguration s3CrtFileIoConfiguration = builder.fileIoConfiguration;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can builder.fileIoConfiguration; be null ? We might need to handle if null condition for builder.fileIoConfiguration;

* <p>
* Notes:
* <ul>
* <li>Only supported on Linux for now.</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way we default it to fault if user sets this for non linux ?

* </ul>
* for additional info https://man7.org/linux/man-pages/man2/openat.2.html
*/
public static final SdkAdvancedAsyncClientOption<Boolean> CRT_UPLOAD_FILE_DIRECT_IO =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create a new Option class for CRT and put CRT specific option there?

}

@Override
public <T> S3CrtAsyncClientBuilder putAdvancedOption(SdkAdvancedAsyncClientOption<T> option, T value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have new option class for CRT like SdkAdvancedAsyncCrtClientOption , else all the options which are available on SdkAdvancedAsyncClientOption might appear as supported for CRT and vice versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants